package com.controller;

import com.entity.RbacMenu;
import com.entity.ResponseEntity;
import com.service.RbacMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rbacMenu")
public class RbacMenuController {
    @Autowired
    RbacMenuService rbacMenuService;
    @GetMapping("/menus")
    public ResponseEntity findAll(){
        return rbacMenuService.findAll();
    }
    @GetMapping("/menus/{roleId}")
    public ResponseEntity findByRoleId(@PathVariable int roleId){
        return rbacMenuService.findByRoleId(roleId);
    }
}
